package com.yuw.oop.polymorphicdemo4;

public class Animal{
	
	// 属性
	private String animalName;
	private String animalColor;
	private String animalSex;
	
	// 构造方法
	
	public Animal(String animalName, String animalColor, String animalSex) {
		super();
		this.animalName = animalName;
		this.animalColor = animalColor;
		this.animalSex = animalSex;
	}

	// 显式提供默认的构造方法供子类调用
	public Animal() {
		super();
	}


	// 行为
	
	/**
	 * 行为方法：吃饭
	 */
	public void doEating() {
		System.out.println(this.animalName + " is eating...");
	}

	/**
	 * 行为方法：睡觉
	 */
	public void doSleeping() {
		System.out.println(this.animalName + " is sleeping...");
	}

	
	public String getAnimalName() {
		return animalName;
	}

	public void setAnimalName(String animalName) {
		this.animalName = animalName;
	}

	public String getAnimalColor() {
		return animalColor;
	}

	public void setAnimalColor(String animalColor) {
		this.animalColor = animalColor;
	}

	public String getAnimalSex() {
		return animalSex;
	}

	public void setAnimalSex(String animalSex) {
		this.animalSex = animalSex;
	}

}
